package com.wicket.okrbff.web.contorller;

import com.wicket.okrbff.biz.service.CaptchaService;
import com.wicket.okrbff.biz.service.dto.req.BffCheckCaptchaValidComReqDto;
import com.wicket.okrbff.biz.service.dto.req.BffQueryGetCaptchaDetailReqDto;
import com.wicket.okrbff.biz.service.dto.res.BffCheckCaptchaValidComRespDto;
import com.wicket.okrbff.biz.service.dto.res.BffQueryGetCaptchaDetailRespDto;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Captcha", tags = {"Captcha"})
@RestController
// @RequestMapping("/oms/captcha/")
public class CaptchaController {

    @Autowired
    CaptchaService captchaService;

    /**
   * B1-发送验证码（公共）
   * gen by moon at 8/10/2022, 3:33:26 AM
   */
    @PostMapping("/oms/captcha/queryGetCaptchaDetail")
    @ApiOperation(value = "B1-发送验证码（公共）", response = OkrResult.class)
    public OkrResult<BffQueryGetCaptchaDetailRespDto> queryGetCaptchaDetail(@RequestBody(required=false) @Validated BffQueryGetCaptchaDetailReqDto reqDTO){
        return OkrResult.success(captchaService.queryGetCaptchaDetail(reqDTO));
    }

    /**
   * B1-检查验证码是否有效(公共)
   * gen by moon at 8/10/2022, 3:38:41 AM
   */
    @PostMapping("/oms/captcha/checkCaptchaValidCom")
    @ApiOperation(value = "B1-检查验证码是否有效(公共)", response = OkrResult.class)
    public OkrResult<BffCheckCaptchaValidComRespDto> checkCaptchaValidCom(@RequestBody(required=false) @Validated BffCheckCaptchaValidComReqDto reqDTO){
        return OkrResult.success(captchaService.checkCaptchaValidCom(reqDTO));
    }
}
